<?php 
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: load.phtml 4214 2010-08-02 03:48:27Z leha $
 * @since		2.0.0
 */
?>
var G_AD_ZONES = new Array();
<?php if ($this->zones != null) : ?>
<?php foreach ($this->zones as $zone) : ?>
G_AD_ZONES['<?php echo $zone->name; ?>'] = { 
	id: <?php echo $zone->zone_id; ?>, 
	name: '<?php echo $zone->name; ?>',
	width: <?php echo $zone->width; ?>,
	height: <?php echo $zone->height; ?>
};
<?php endforeach; ?>
<?php endif; ?>

var G_AD_BANNERS = new Array();
<?php if ($this->banners != null) : ?>
<?php foreach ($this->banners as $banner) : ?>
G_AD_BANNERS[G_AD_BANNERS.length] = {
	id: '<?php echo $banner->banner_id; ?>', 
	zone: { 
		id: <?php echo $banner->banner_zone_id; ?> 
	}, 
	options: { 
		format: '<?php echo $banner->format; ?>', 
		text: '<?php echo addslashes($banner->text); ?>', 
		code: <?php echo Zend_Json::encode($this->htmlCompressor($banner->code)); ?>, 
		clickUrl: '<?php echo addslashes($banner->click_url); ?>', 
		target: '<?php echo $banner->target; ?>', 
		imageUrl: '<?php echo $banner->image_url; ?>', 
		pageUrl: '<?php echo str_replace('\\', '\\\\', $banner->page_url); ?>', 
		route: '<?php echo $banner->route; ?>', 
		mode: '<?php echo $banner->mode; ?>', 
		timeout: <?php echo $banner->timeout; ?>
	},
	baseUrl: '<?php echo $this->baseUrl(); ?>'
};
<?php endforeach; ?>
<?php endif; ?>
